]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
renameFolderMenu: Set the entry as menu focus actor
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Wed, 11 Sep 2019 18:09:08 +0000 (20:09 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Fri, 20 Sep 2019 15:53:42 +0000 (15:53 +0000)
When the rename folder menu is opened the text entry is expected to be
focused and selected for a quick editing.
While this is required it doesn't actually happens since PopupMenu by
default gives the key focus to the source actor, that is then free to pass
the key focus to the menu if there's an user interaction.

In this case however, we want the text entry to be focused once we prompt
the menu, so just use the PopupMenu's focusActor property to ensure it will
handle it for us.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1604
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/720

js/ui/appDisplay.js

index 39fa99e7ed671540b7a16771ff12a75f53d7bf71..b1f9a122c71a898a343c6404cf615fd359345e2f 100644 (file)
@@ -1732,6 +1732,9 @@ var RenameFolderMenu = class RenameFolderMenu extends PopupMenu.PopupMenu {
         });
         box.add_child(this._entry);
 
+        // Focus the text entry on menu pop-up
+        this.focusActor = this._entry.clutter_text;
+
         this._entry.clutter_text.connect('notify::text',
                                          this._validate.bind(this));
         this._entry.clutter_text.connect('activate',